<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    #box1 {
      width: 100px;
      height: 100px;
      background-color: aqua;
      border-radius: 50%;
      position: absolute;
    }
    #box4{
        width: 100px;
        height: 100px;
        background-color: blue;
        position: absolute;
        bottom: 0px;

        
    }
    #box3{
        width: 200px;
        height: 200px;
        background-color: chartreuse;


    }
    #box2{
        width: 500px;
        height: 500px;
        background-color: beige;
    }
  </style>
  <body>
    <div id="box1"></div>
    <div id="box2"></div>
    <div id="box3" onclick="alert(3)" >
      <div id="box4" onclick="alert(3)"></div>
    </div>
    <script>
      // 让小球跟着鼠标移动
      const box1 = document.getElementById('box1');
      document.addEventListener('mousemove', (event) => {
        box1.style.left = event.x + 'px';
        box1.style.top = event.y + 'px';
      });
      /* 
        事件的冒泡和元素的样式无关,只与结构相关
      */
     const box2 = document.getElementById("box2")
    //  box2.addEventListener("mousemove",event =>{
        // event.stopPropagation()
    //  })
    //  
    </script>
  </body>
</html>
